package com.lht.arithmetic.tree.binaryTree.avl;

import java.util.Objects;

/**
 * @author Eric
 * @version 1.0
 * @date 2020-05-25
 */
class Student implements Comparable<Student> {

    private int gradeNum;

    private int classNum;

    private int StudentNo;

    private String name;

    private int age;

    private int totalScore;

    public Student(int studentNo) {
        this(studentNo, null, 0);
    }

    public Student(int studentNo, String name, int totalScore) {
        StudentNo = studentNo;
        this.name = name;
        this.totalScore = totalScore;
    }

    @Override
    public int compareTo(Student o) {
        return this.totalScore - o.totalScore;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return StudentNo == student.StudentNo;
    }

    @Override
    public int hashCode() {
        return Objects.hash(StudentNo);
    }

    public int getGradeNum() {
        return gradeNum;
    }

    public void setGradeNum(int gradeNum) {
        this.gradeNum = gradeNum;
    }

    public int getClassNum() {
        return classNum;
    }

    public void setClassNum(int classNum) {
        this.classNum = classNum;
    }

    public int getStudentNo() {
        return StudentNo;
    }

    public void setStudentNo(int studentNo) {
        StudentNo = studentNo;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getTotalScore() {
        return totalScore;
    }

    public void setTotalScore(int totalScore) {
        this.totalScore = totalScore;
    }
}
